//
//  ZHFTrip.m
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "ZHFTrip.h"

#import "ZHFUser.h"

#import "ZHFNotes.h"

@implementation ZHFTrip

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tripArray = [NSMutableArray array];
    }
    return self;
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"description"]) {
        
        self.descriptions = value;
    }
    if ([key isEqualToString:@"trip"]) {
        NSDictionary *dic = [value objectForKey:@"user"];
        self.user = [ZHFUser modelWithDictionary:dic];
        
    }
    if ([key isEqualToString:@"notes"]) {
        for (NSDictionary *dic in value) {
            ZHFNotes *notes = [ZHFNotes modelWithDictionary:dic];
            [self.tripArray addObject:notes];
        }
    }
}



@end
